package com.data.modules.smzh.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.data.modules.smzh.entity.SmzhLimitNum;
import com.data.modules.smzh.mapper.SmzhLimitNumMapper;
import com.data.modules.smzh.service.ISmzhLimitNumService;
import com.data.modules.smzh.entity.SmzhLimitNum;
import com.data.modules.smzh.service.ISmzhLimitNumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 限号记录表
 * @Author: data-boot
 * @Date:   2023-01-12
 * @Version: V1.0
 */
@Service
public class SmzhLimitNumServiceImpl extends ServiceImpl<SmzhLimitNumMapper, SmzhLimitNum> implements ISmzhLimitNumService {

    @Autowired
    private SmzhLimitNumMapper smzhLimitNumMapper;

    @Override
    public String queryDayLimitNum(String cityName) {

        String paramStr = smzhLimitNumMapper.queryWeek();

        String msg = smzhLimitNumMapper.queryLimitNum(paramStr,cityName);
        if(ObjectUtil.isEmpty(msg)){
            msg = "不限号";
        }

        return msg;
    }

    @Override
    public String queryDayLimitByCityCode(String cityCode) {
        String paramStr = smzhLimitNumMapper.queryWeek();

        String msg = smzhLimitNumMapper.searchLimitNumBycityCode(paramStr,cityCode);
        if(ObjectUtil.isEmpty(msg)){
            msg = "不限号";
        }

        return msg;
    }
}
